package com.parse;

import com.parse.dto.Product;
import com.parse.utils.ExcelUtil;
import com.parse.utils.JsoupUtils;

import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by fangjicai on 2020/5/11.
 */
public class App {
    public static void main(String[] args) throws Exception{
        //获取所有商品页面url地址，通过分析https://www.mytheresa.com/en-gb/designers/gucci/bags.html?p=1
        //共有5页，可分配5个线程去执行抓取任务
        ArrayList<String> urls = new ArrayList<>();
        for(int i=1;i<6;i++){
            urls.add("https://www.mytheresa.com/en-gb/designers/gucci/bags.html?p="+i);
        }
        //执行抓取任务，获取商品集合
        List<Product> allProduct = new JsoupUtils().getData(urls);
        //将数据导出的Excell
        ExcelUtil.createWorkBook(allProduct);
    }
}
